package org.example.afiona.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.example.afiona.common.VO.ResultVO;
import org.example.afiona.service.OrderFeignApi;
import org.example.afiona.service.VO.OrderInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: leo
 * @date: 2021/6/9
 */
@RestController
@RefreshScope
@Api(tags = "用户")
public class UserController {

    @Autowired
    private OrderFeignApi orderFeignApi;

    @GetMapping("/user/order/list")
    @ApiOperation("获取用户订单列表")
    public ResultVO<List<OrderInfoVO>> getUserOrderList() {
        ResultVO<List<OrderInfoVO>> orderList = orderFeignApi.getOrderListByUserId(1);
        return orderList;
    }
}
